﻿@model IEnumerable<Blog.Model.Reg>

<style>
    .tou {
        position: relative;
        left: -247px;
        width: 2000px;
        height: 1000px;
        background-image: url(/image/登录.jpg);
        z-index: -20
    }

    .v {
        position: relative;
        left: 1000px;
        top: 500px;
        background-color: white;
        width: 400px;
        height: 200px;
    }

        .v #bt {
            position: relative;
            left: 100px;
        }

    #hang {
        position: relative;
        top: -10px;
        left: 50px;
    }

    #hang-f {
        position: relative;
        top: 5px;
        left: 50px;
    }

    #den {
        position: relative;
        top: 20px;
        left: 70px;
    }

    #zhu {
        position: relative;
        top: 5px;
        left: 200px;
    }
</style>
<div class="tou">
    @using (Html.BeginForm("index"))
    {
        <div class="v">
            <h1 id="bt">登录</h1>
            <hr />
            <div id="hang">
                账号: @Html.TextBox("UserName", "", new { onblur = "cnwnt()" })
                <span id="emails" style="color:red"></span>
            </div>
            <div id="hang-f">
                密码: @Html.Password("Passwoed", "", new { onblur = "pass()" })
                <span id="fg" style="color:red"></span>
            </div>

            <div id="den">
                <input id="Button1" type="submit" value="登录" />
            </div>
            <div id="zhu">
                <a href="https://localhost:44376/Regs/index">注册</a>

                @*@Html.ActionLink("去注册", "index", "zhuce", "", new { @id = "zc" })*@
            </div>
        </div>
    }
</div>
    <script>
        $(function () {
            $("form").bind("submit", sheckForm);
        });
        function cnwnt() {
            if ($("#UserName").val() == "") {//账户不能为空
                $("#emails").html("账户不能为空！");
                $("#UserName").focus();
                return false;
            } else {
                $("#emails").html("");
            }
            return true;//验证通过
        } function sheckForm() {
            if (cnwnt()) {
                return true;
            } return false;
        }
        //密码验证
        $(function () {
            $("form").bind("submit", ff);
        });
        function pass() {
            if ($("#Passwoed").val() == "") {//验证邮箱不能为空
                $("#fg").html("密码不能为空！");
                $("#Passwoed").focus();
                return false;
            } else {
                $("#fg").html("");
            }
            return true;//验证通过
        } function ff() {
            if (pass()) {
                return true;
            } return false;
        }
    </script>
}